






typedef struct tagLAYOUT_NODE {
    short type;                    /* 2 @ 0x00 node type */
    short b;                       /* 2 @ 0x02 init to first param in high half and 1 in low half */
                                   /*          high byte seems to be a render mode number */
    struct tagLAYOUT_NODE *prev;   /* 4 @ 0x04 */
    struct tagLAYOUT_NODE *next;   /* 4 @ 0x08 */
    struct tagLAYOUT_NODE *parent; /* 4 @ 0x0c parent */
    struct tagLAYOUT_NODE *child;  /* 4 @ 0x10 child */
} LAYOUT_NODE;

/***************/
type   size     made with command
0x001  0x24     0x08
0x004  0x54 ?
0x019  0x20     0x13
0x01b  0x18     0x15
0x01c  0x1c     0x1d
0x028  0x18     0x16
0x10c  0x20     0x0e

typedef struct tagLAYOUT_NODE_0x04 {
    struct tagLAYOUT_NODE node;
    struct dlist_node *headptrs[8];   /* 0x20 @ 0x14 */
    struct dlist_node *lastnodes[8];  /* 0x20 @ 0x34 */
} LAYOUT_NODE_0x04;

typedef struct tagLAYOUT_NODE_0x09 {
    struct tagLAYOUT_NODE node;
    char a;   /* 1 @ 0x14 */
    char b;   /* 1 @ 0x15 */
    short c;  /* 2 @ 0x16 */
    short d;  /* 2 @ 0x18 */
    short e;  /* 2 @ 0x1a */
    short f;  /* 2 @ 0x1c */
    short g;  /* 2 @ 0x1e */
    long h;   /* 2 @ 0x20 */
} LAYOUT_NODE_0x09;

typedef struct tagLAYOUT_NODE_0x19 {
    struct tagLAYOUT_NODE node;
    uint32_t segptr;                  /* 4 @ 0x14 */
    short arr[3];                     /* 6 @ 0x1a */
} LAYOUT_NODE_0x19;                   /*END@ 0x20 */


typedef struct tagLAYOUT_NODE_0x1B {
    struct tagLAYOUT_NODE node;
    uint32_t segptr;
} LAYOUT_NODE_0x1B;


/* type:0x1c  size:0x1c   Generated by command 0x1d */
typedef struct tagLAYOUT_NODE_0x1C {
    struct tagLAYOUT_NODE node;
    long l;  /* if high bit of first param byte is set, this is set to the 32 bit value at offset 0x8, else set to zero */
    float f; /* = (layout_wp->off0x04>=0)?(layout_wp->off0x04):(layout_wp->off0x04+4294967296.0) / 65536.0; */
} LAYOUT_NODE_0x1C;

typedef struct tagLAYOUT_NODE_0x10C {
    struct tagLAYOUT_NODE node;                                       /* 0x14 @ 0x00 */
    void (*func)(int, LAYOUT_NODE_0x10c *, struct allocation_stack);  /*    4 @ 0x14 - function to call for this node */
    u32 a;                                                            /*    4 @ 0x18 - init'd to zero */
    short b;                                                          /*    2 @ 0x1c - set from offset 2 in the command */
    short chosen_child;                                               /*    2 @ 0x1e - index of child to use - init'd to zero */
} LAYOUT_NODE_0x10C;

typedef struct tagLAYOUT_NODE_0x28 {
    struct tagLAYOUT_NODE node;
    char g;
    char h;
    char i;
} LAYOUT_NODE_0x28;







/********** OLD **************/
typedef struct tagLAYOUT_NODE_A {
    short type;                           /* 2 @ 0x00 */
    short b;                              /* 2 @ 0x02 init to first param in high half and 1 in low half */
    struct tagTHREESIXTEENTARGET *next;   /* 4 @ 0x04 init to a self pointer */
    struct tagTHREESIXTEENTARGET *prev;   /* 4 @ 0x08 init to a self pointer */
    long e;                               /* 4 @ 0x0c */
    long f;                               /* 4 @ 0x10 */
    char g;
    char h;
    char i;
} LAYOUT_NODE_A;



typedef struct tagLAYOUT_NODE_B {
    short type;                           /* 2 @ 0x00 */
    short b;                              /* 2 @ 0x02 init to first param in high half and 1 in low half */
    struct tagTHREESIXTEENTARGET *next;   /* 4 @ 0x04 init to a self pointer */
    struct tagTHREESIXTEENTARGET *prev;   /* 4 @ 0x08 init to a self pointer */
    long e;                               /* 4 @ 0x0c */
    long f;                               /* 4 @ 0x10 */
    uint32_t segptr;                      /* 4 @ 0x14 segmented pointer to GBI commands */
    short arr[3]                          /* 6 @ 0x18 copied from command */
                                          /* @ 0x1e end? */
} LAYOUT_NODE_B;
